<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui">
<body>
	<ui:composition>
		<p:dialog header="Part Unit Detail" widgetVar="partUnitDialog"
			modal="true" showEffect="fade" hideEffect="fade" resizable="false">
			<p:outputPanel id="partUnitDetail" style="text-align:center;">
				<p:panelGrid rendered="#{not empty dtPartUnitLazyView.selectedItem}"
					columnClasses="label,value">
					<f:facet name="header">
						<p:row>
							<p:column>Name</p:column>
							<p:column>Brand</p:column>
							<p:column>Unit</p:column>
							<p:column>Part Number</p:column>
						</p:row>
					</f:facet>
					<p:row>
						<p:column>#{dtPartUnitLazyView.selectedItem.shortName}</p:column>
						<p:column>#{dtPartUnitLazyView.selectedItem.shortBrand}</p:column>
						<p:column>#{dtPartUnitLazyView.selectedItem.shortUnit}</p:column>
						<p:column>#{dtPartUnitLazyView.selectedItem.part}</p:column>
					</p:row>

				</p:panelGrid>

				<br />
				<p:panelGrid rendered="#{not empty dtPartUnitLazyView.selectedItem}"
					columnClasses="label,value">
					<f:facet name="header">
						<p:row>
							<p:column>Enter Quantity</p:column>
						</p:row>
					</f:facet>
					<p:row>
						<p:column>
							<p:inputText id="quantity" value="#{dtPartUnitLazyView.quantity}"
								required="true" requiredMessage="Please enter quantity!">
								<f:convertNumber minFractionDigits="2" />
							</p:inputText>
							<h:outputText value="#{dtPartUnitLazyView.selectedItem.shortUnit}" />
						</p:column>
					</p:row>
					<p:row>
						<p:column><h:message for="quantity" /></p:column>
					</p:row>
				</p:panelGrid>
				
				<p:commandButton value="Add" update=":reqTableForm @form" action="#{dtPartUnitLazyView.addItem}" />

			</p:outputPanel>
		</p:dialog>
	</ui:composition>
</body>
</html>